<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>edit product page</title>
</head>
<body>
<h1>edit product page</h1>
<hr>
<form action="/product/modify" method="post" enctype="multipart/form-data">
    <input type="hidden" name="id" value="${sessionScope.product.id}">
    <input type="text" name="title" placeholder="TITLE" required value="${sessionScope.product.title}">
    <select name="type">
        <option value="自营">自营</option>
        <c:if test="${sessionScope.product.type eq '第三方'}">
            <option value="第三方" selected="selected">第三方</option>
        </c:if>
        <c:if test="${sessionScope.product.type ne '第三方'}">
            <option value="第三方">第三方</option>
        </c:if>
    </select>
    <br>
    <textarea name="description" cols="33" rows="5"
              placeholder="DESCRIPTION">${sessionScope.product.description}</textarea>
    <br>
    <input type="number" min="0.00" max="99999.99" step="0.01" name="originalPrice" placeholder="ORIGINAL PRICE"
           value="${sessionScope.product.originalPrice}">
    <br>
    <input type="number" min="0.00" max="99999.99" step="0.01" name="currentPrice" placeholder="CURRENT PRICE"
           value="${sessionScope.product.currentPrice}">
    <br>
    <img src="/pictures/${sessionScope.product.picture}" height="100">
    <input type="file" name="file" value="${sessionScope.product.picture}">
    <br>
    <input type="submit" value="save">
</form>
</body>
</html>
